package cn.tedu.spring.eg_beanLife;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestShopController {
    public static void main(String[] args) {

        try{
            // 使用接口类实现实例化
            AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(
                    "cn.tedu.spring.eg_beanLife"
            );

            // 开发者使用阶段
            // genBean获取对象
            ShopController shopController = context.getBean(ShopController.class);
            System.out.println("开发者使用阶段(第四阶段)" + shopController);

            // 手动关闭IoC容器
            context.close();
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
